package foodmaterial.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import foodmaterial.action.valid.ObjectNullValid;
import foodmaterial.utils.Constants;

import javax.validation.Valid;
import javax.validation.constraints.Past;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

public class StockBill implements Serializable {

    private static final long serialVersionUID = -8508627714049151139L;

    private Long id ;
    @JsonFormat(pattern= Constants.DEFAULT_DATE_FORMAT,timezone="GMT+8")
    @ObjectNullValid(message = "入库日期不能为空")
    @Past(message = "入库日期不能大于当前系统日期")
    private Date stockDate ;
    private String remark ;
    private Long operationPerson ;
    private String operationPersonName ;
    @JsonFormat(pattern=Constants.DEFAULT_DATE_TIME_FORMAT,timezone="GMT+8")
    private Date operationDate ;
    private Long lastOperationPerson ;
    private String lastOperationPersonName ;
    @JsonFormat(pattern=Constants.DEFAULT_DATE_TIME_FORMAT,timezone="GMT+8")
    private Date lastOperationDate ;
    @Size(min= 1,message = "损溢单最少有一条明细")
    @Valid
    private List<StockBillDetail> detail ;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Date getStockDate() {
        return stockDate;
    }

    public void setStockDate(Date stockDate) {
        this.stockDate = stockDate;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public Long getOperationPerson() {
        return operationPerson;
    }

    public void setOperationPerson(Long operationPerson) {
        this.operationPerson = operationPerson;
    }

    public String getOperationPersonName() {
        return operationPersonName;
    }

    public void setOperationPersonName(String operationPersonName) {
        this.operationPersonName = operationPersonName;
    }

    public Date getOperationDate() {
        return operationDate;
    }

    public void setOperationDate(Date operationDate) {
        this.operationDate = operationDate;
    }

    public Long getLastOperationPerson() {
        return lastOperationPerson;
    }

    public void setLastOperationPerson(Long lastOperationPerson) {
        this.lastOperationPerson = lastOperationPerson;
    }

    public String getLastOperationPersonName() {
        return lastOperationPersonName;
    }

    public void setLastOperationPersonName(String lastOperationPersonName) {
        this.lastOperationPersonName = lastOperationPersonName;
    }

    public Date getLastOperationDate() {
        return lastOperationDate;
    }

    public void setLastOperationDate(Date lastOperationDate) {
        this.lastOperationDate = lastOperationDate;
    }

    public List<StockBillDetail> getDetail() {
        return detail;
    }

    public void setDetail(List<StockBillDetail> detail) {
        this.detail = detail;
    }
}
